Updated image file validation