def get_timeline_image_thumbnail_name(attachment): if attachment.attached_file: thumbnail = get_thumbnail(attachment.attached_file, settings.THN_ATTACHMENT_TIMELINE) return thumbnail.name if thumbnail else None return None