Fixed minor bugs in the picture upload