Added handling for files without images