validate image uploads (bug 1030388)