Take care of some errors uploading images and enforce file type upload on the backend, fix suggested by logic, add error functions on ajax calls.