Fixed upload code for galleries and sole pictures.