Added client-side image validation