Fixes first/last image links