Implemented image file handling