Add unittests & check filetype in setLocalAvatar()

TODO: Fix OC_Image->mimetype(), it always returns "image/png"