I have the following method to create a thumbnail, but I would like it also to generate it in case the file type is png, as it currently throws an error for