I tend to post jpeg and png files.

If the format is OK it could be a slow upload speed (I have had less trouble since switching broadband provider) or simply down to the size of the file. Although I think I just get a message that the file failed to upload rather than it being invalid.

Two quick ways I have found to reduce the size are to take a screen shot and use that, or to use files I have previously uploaded to facebook or similar as they are automatically compressed or optimised for websites - rather than uploading the full size files from my macbook.