Gallery upload fix