And Ruby to the rescue too.
This does what you want and extends image handling to other formats as well. I have tested it both in the Terminal and as an Automator application. It does not currently support multiple folder selection.
The Automator workflow:

and the ruby code that goes in the Run Shell Script workflow window:
#!/usr/bin/ruby
# content: UTF-8
# Usage: program.rb folder
# Author: VikingOSX, 01/14, Apple Support Community
require 'find'
require 'fileutils'
init_folder, parent_folder, fextension, newfile = String.new
pathnfo, filenfo = Array.new
# pattern to filter on filename extensions
filetype_regex = /[^\/:]+\.(?i:jpeg|jpg|cr2|png|gif|svg)/
# Argument passed and forced to string
init_folder = ARGV.join("")
# get the full path to folder passed as argument
parent_folder = File.realdirpath(init_folder)
# Walk down directory hierarchy as main loop
Find.find(parent_folder) do |xfile|
if File.directory?(xfile)
# keep the current full path and directory/file name in an array
pathnfo = File.split(xfile)
next
else
# Either there is a filename match with returned image extension as string
# or a nil is returned
imagename = filetype_regex.match(xfile).to_s unless xfile.include? ".DS_Store"
if imagename == nil
next
end
filenfo = File.split(xfile)
extension = File.extname(imagename)
#make folder from current base image name
xfiledir = File.join(pathnfo.first, pathnfo.last, File.basename(xfile, extension))
FileUtils.mkdir_p(xfiledir) unless File.directory?(xfiledir)
# make an image type sub-folder and move respective file to it.
case extension.downcase
when ".jpg", ".jpeg"
jpgfolder = File.join(xfiledir, "JPG")
FileUtils.mkdir_p jpgfolder unless File.directory?(jpgfolder)
xfilejpg = File.join(jpgfolder, filenfo.last)
FileUtils.mv(xfile, xfilejpg)
next
when ".cr2"
rawfolder = File.join(xfiledir, "RAW")
FileUtils.mkdir_p rawfolder unless File.directory?(rawfolder)
xfileraw = File.join(rawfolder, filenfo.last)
FileUtils.mv(xfile, xfileraw)
next
when ".png"
pngfolder = File.join(xfiledir, "PNG")
FileUtils.mkdir_p pngfolder unless File.directory?(pngfolder)
xfilepng = File.join(pngfolder, filenfo.last)
FileUtils.mv(xfile, xfilepng)
next
when ".gif"
giffolder = File.join(xfiledir, "GIF")
FileUtils.mkdir_p giffolder unless File.directory?(giffolder)
xfilegif = File.join(giffolder, filenfo.last)
FileUtils.mv(xfile, xfilegif)
next
when ".svg"
svgfolder = File.join(xfiledir, "SVG")
FileUtils.mkdir_p svgfolder unless File.directory?(svgfolder)
xfilesvg = File.join(svgfolder, filenfo.last)
FileUtils.mv(xfile, xfilesvg)
next
else
puts "Something poignantly went wrong"
next
end
end
end