Created a new model to store uploaded images from form.
Created a new "form" class based on StoredDocs class.
This will make easy to work with the class StoredDocs in our form.
Changed the "attachment" field.
Now in this field we store just the ID of the uploaded file.
This could be changed with a better AJAX call I suppose but for now this is the
better solution I found to upload an image via AJAX.