Upload images .jpeg fails - .jpg ok             #1136

Image with .jpeg extensions were not uploaded successfully because the code snippet to get the extension was picking the last four characters of the filename which includes the dot[.] which was being missed for the case of the .jpeg which is five characters plus the dot.

The fix gets the file type using the last appearance of the dot on the filename thus works for all file types.
Merge pull request #1152 from Brevin/patch-1

Upload images .jpeg fails - .jpg ok             #1136