added css class to style validation state properly
added javascript to handle the hidden inputs so that validation works correctly for the images