Ajax image rotate, checks if image editing is allowed for user, some fixed problems with image load