Prevent uploading of anything other than images

Wait for the preview image to load. If it fails to do so
assume a bad filetype has been given.

Change-Id: I4a3404380524ae6b16d431024d706e0089ae0258
Merge "Prevent uploading of anything other than images"