Refactored imageContentTypeForFile using fileTypeForFile to simplify the code. Also added a couple more unit tests around both functions